home *** CD-ROM | disk | FTP | other *** search
- Subject: Offscreen bitmaps & switching between two contexts
- Sent: 4/15/96 4:26 PM
- Received: 4/15/96 4:41 PM
- From: Gary Ashcraft, ashcraft@itsnet.com
- Reply-To: ODF-Interest@CILabs.ORG
- To: OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
-
- Greetings,
- I have created a render class that contains an offscreen bitmap created
- with the following code:
-
- fOffScreenBitmap = FW_NEW(FW_PBitmap,
- (fOffScreenRect.right.AsInt(),
- fOffScreenRect.bottom.AsInt(), 0));
-
- fOffScreenBitmap is a member variable of my class defined as FW_PBitmap*.
-
- I want to be able to create and maintain a FW_CBitmapContext and store it
- in my class. Then, when I want to render to the offscreen, I'll save the
- current context and then switch the context to my offscreen bitmap context.
-
- FW_CBitmapContext is an auto destruct class and seems to perform its magic
- (i.e. switch the context etc.) when the class is created. How do I create
- one of these, save the current context, switch the context and switch the
- context back once I am done?
-
- All of the examples I have seen create this class as a temporary variable
- immediately before doing their rendering. This is not suitable for what I
- am trying to accomplish. I need to be able to create the context in the
- initialize method of my class, set it in other methods of my class and
- delete it in the destructor of my class.
-
- BTW, what is the proper way to dispose of an object created with the FW_NEW
- macro? Since I only create one instance of the class I currently do a
- "delete fOffScreenBitmap". Is this the correct way to handle this?
-
- Thanks for your help,
- Nolan Larsen
- Digital Harbor
-
-